﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>编辑会员信息</title>
<link href="../../Client/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../js/function.js" type="text/javascript"></script>
<script src="../js/base.js" type="text/javascript"></script>
<script src="../js/dialog.js" type="text/javascript"></script>
<script src="../js/jquery-form.js" type="text/javascript"></script>
<script src="../js/ajax-data.js" type="text/javascript"></script>
<script src="../js/Pager.js" type="text/javascript"></script>
<style>
.foot_btn_box{ text-align:left; margin-left:200px;}
li.selected {height:23px;}
.selected a:hover{ text-decoration:none;}
td input {width:300px; padding-left:5px;}
table{border-collapse: collapse;border: none; text-align:center;}
.list{ min-width:700px;}
.list td{border: solid #ccc 1px;color:Black; height:26px;}

/*分页*/
.pager_style{width:100%;height:30px;margin-top:10px;text-align:left;color:#909090;}
.pager_style li{font-size:14px;}
.pager_style .page_num{height:100%;font-size:0;display:inline-block; float:left;}
.pager_style .page_num li{height:100%;border:1px solid #eeeeee;padding:0 10px;margin-right:5px;line-height:30px;display:inline-block;cursor:pointer;float:left;}
.pager_style .page_num li:hover{border:1px solid #f37b0b;background-color:#f37b0b;color:White;}

/*分页 选中当页样式*/
.pager_style .page_num .active{border:1px solid #f37b0b;background-color:#f37b0b;color:White;cursor:default;}
/*分页 不可用样式*/
.pager_style .page_num .disable{background-color:#f1f1f1;}
.pager_style .page_num .disable:hover{border:1px solid #eeeeee;background-color:#f1f1f1;color:#909090;}

.pager_style .page_info{display:none;float:left;}
.pager_style .page_info li{display:inline-block;margin-left:10px;float:left;line-height: 30px;}
</style>
</head>
<body class="mainbody">
<form id="form1" runat="server">
<div class="navigation"><a href="javascript:" class="back">后退</a>首页 &gt; 微街秀代理商 &gt; 代理商信息</div>
<div id="tab">
    <ul class="tab_nav">
        <li class="selected"><a id="tab1" onclick="tabs('#tab',0);" href="javascript:;">基本信息</a></li>
        <li><a  href="javascript:" onclick="tabs('#tab',1);">小计列表</a></li>
        <li ><a id="tab2" href="javascript:">提单记录</a></li>
    </ul>

    <div class="tab_con" style="display:block;">
        <table class="form_table">
            <col width="150px"><col>
            <tbody>
            <tr>
                <th>微街秀ID：</th>
                <td><input type="text" id="userid_wjx" /></td>
            </tr>
            <tr>
                <th>公司名：</th>
                <td><input type="text" id="sitename" />
                </td>
            </tr>
             <tr>
                <th>状态：</th>
                <td><input type="text" id="status" /></td>
            </tr>
            <tr>
                <th>折扣：</th>
                <td><input type="text" id="discount" /></td>
            </tr>
            <tr>
                <th>联系人：</th>
                <td>
                   <input type="text" id="linkman" />
                </td>
            </tr>
            <tr>
                <th>电话：</th>
                <td><input type="text" id="phone" /></td>
            </tr>
            <tr>
                <th>加入时间：</th>               
                <td>
                    <input type="text" id="jointime" />
                </td>
            </tr>
            <tr>
                <th>过期时间：</th>
                <td><input type="text" id="endtime" /></td>
            </tr>
            <tr>
                <th>余 额：</th>
                <td>
                    <input type="text" id="balance" />
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="tab_con">
        <table class="list">
            <tr class="th">
                <td>微街秀ID</td>
                <td style="width:260px">公司名</td>
                <td>QD名称</td>
                <td style="width:60px">类别</td>
                <td>内容</td>
                <td style="width:100px">时间</td>
            </tr>
            <tbody id="list"></tbody>
        </table>        
         <div class="pager_style">
            <ul class="page_num"></ul>
            <ul class="page_info">
                <li>总数:<span id="count">0</span></li>
                <li>每页:<span id="pageSize">0</span></li>
                <li>页数:<span id="pageToal">0</span></li>
            </ul>
        </div>
    </div>

    <div class="foot_btn_box">
    <input type="button" value=" 返回列表 " onclick="window.location.href='list.html'" />
    <input type="button" value=" 写备注 " onclick="window.location.href='list.html'" />
    </div>
</div>
</form>
<script>
    $(function () {
        //指定显示选项卡
        if (location.href.indexOf("#tab1") > -1) {
            tabs('#tab', 1);
        }
        Get();
        GetList(1)
    })
    function Get() {
        if (getUrlArgStr("agentid") == null) return;
        var param = "&user_id=" + getUrlArgStr("agentid");

        AjaxStart("../ajax/agent.ashx?detail", param, function (data) {
            if (data.code != 0) {
                Alert(data.msg);
            }
            else {
                $("#userid_wjx").val(data.item.userid_wjx);
                $("#sitename").val(data.item.sitename);
                $("#discount").val(parseFloat(data.item.discount) * 0.1 + "折");
                $("#linkman").val(data.item.linkman);
                $("#phone").val(data.item.Phone);
                $("#jointime").val(GetDate(data.item.JoinTime));
                $("#endtime").val(GetDate(data.item.endtime));
                $("#balance").val("￥ " + data.item.balance + "元");
                var status = parseInt(data.item.status);
                if (status == 4)
                    $("#status").val("正常");
                else if(status==8)
                    $("#status").val("禁用");

                $("#tab1").attr("href", "detail.html?agentid=" + getUrlArgStr("agentid") + "&sitename=" + $("#sitename").val());
                $("#tab2").attr("href", "list_jilu.html?agentid=" + getUrlArgStr("agentid") + "&sitename=" + $("#sitename").val());
            }
        });
    }

    function GetList(page) {
        var agentid = getUrlArgStr("agentid");
        $("#list").html("");
        if (agentid == "") return;
        var param = "agentid=" + agentid + "&page=" + page;
        AjaxStart("../ajax/agent.ashx?getlist_jilu", param, function (data) {
            if (data.code != 0) {
                $("#list").html("<tr><td colspan='6'>" + data.msg + "</td></tr>");
            }
            else {
                var list = data.item.table;
                if (list.length == 0)
                    $("#list").append("<td colspan='6' style='height:60px;'>没有记录</td>");
                for (var i in list) {
                    $("#list").append("<tr><td>" + list[i].agentid + "</td>" +
                    "<td>" + list[i].sitename + "</td>" +
                    "<td>" + list[i].adminid + "</td>" +
                    "<td class='col4'>" + list[i].type + "</td>" +
                    "<td style='text-align:left'>" + list[i].contents + "</td>" +
                    "<td>" + list[i].createtime.replace("T", " ") + "</td></tr>");
                }
                var pager = new Pager();
                $(".page_info").css("display", "block")
                pager.initPage(page, data.item.itemCount, 20, 5, GetList);
            }
        });
    }
</script>
</body>
</html>
